<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"         
      xmlns:ui="http://java.sun.com/jsf/facelets">

    <h:body>
        <ui:composition template="/templates/templateNECS.xhtml">

            <ui:define name="top">
                Escolha uma Farmacia
            </ui:define>

            <ui:define name="left">
                <h:outputLink value="admin_produto_index.xhtml" >Gerir Produtos</h:outputLink>
                <br /><br /> 
                <h:outputLink value="./../index.xhtml?faces-redirect=true" >Logout</h:outputLink>
                <br /><br />                                    
            </ui:define>

            <ui:define name="content">
                <h:form>
                    <h:dataTable
                        var="farmacia"
                        summary="Lista de todos as farmacias"
                        value="#{administradorManager.farmacias}"
                        rules="all"
                        cellpadding="5">

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Nome" />
                            </f:facet>
                            <h:commandLink  action="#{administradorManager.setFarmaciaAtualByNome(farmacia.nome)}">#{farmacia.nome}</h:commandLink>
                            <!--Falta validar o formato-->
                        </h:column>


                    </h:dataTable>
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>